1. Field of the Invention
The present invention is a storage apparatus, such as a magnetic disk apparatus equipped with a shock sensor, and its control method and program and, particularly, to a storage apparatus that protects information stored in a medium by detecting a shock to disable writing, and its control method and program.
2. Description of the Related Arts
Conventionally, as for a storage apparatus, such as a magnetic disk apparatus, a shock sensor is placed in the storage apparatus to determine that a detection output of the shock sensor when a shock is externally applied exceeds a predetermined threshold and disable a writing operation during a predetermined time until an impact by shock converges, thereby achieving protection so that data is prevented from being destroyed by writing onto an adjacent cylinder with a head actuator being vibrated by shock. Here, as a shock sensor for use in a storage apparatus, a piezoelectric element is used for example. When a power supply voltage of the storage apparatus is fluctuated, output fluctuations also occur in an output of the shock sensor in accordance with power supply fluctuations, thereby erroneously detecting a shock. As such, if an output of the shock sensor is erroneously detected due to power supply fluctuations, in the case where a write command is being executed at this timing, write disable causes a write fault, and then a retry is performed. However, if an erroneous detection occurs due to power supply fluctuations even at the time of retry, write disable causes the retry to become at fault, thereby possibly causing an error termination. To get around this problem, in a conventional storage apparatus, a process of invalidating a detection output of the shock sensor at the time of a specific retry is performed, in which a writing operation is performed by ignoring an erroneous operation of the shock sensor.    [Patent Document 1] Japanese Patent Laid-Open Publication No. 7-61320    [Patent Document 2] Japanese Patent Laid-Open Publication No. 7-6487
However, in such a conventional storage apparatus in which a writing operation is performed by invalidating a detection output of the shock sensor at the time of a specific write retry, if a shock is actually applied while the detection output of the shock sensor is invalidated, the shock cannot be detected, and a writing operation is performed in the state where the shock is applied, thereby posing a problem of destroying data in an adjacent cylinder. Moreover, at the time of an erroneous detection of the shock sensor due to fluctuations in power supply voltage, writing is disabled until a specific retry is performed, thereby posing a problem of worsening writing capability.